<!-- 小程序中转页，用于人脸验证后跳回小程序 -->
<template>
  <div></div>
</template>

<script>
export default {
  mounted() {
    // 创建一个新的URL对象
    const url = new URL(window.location.href);

    // 使用URLSearchParams获取参数
    const params = new URLSearchParams(url.search);

    // 获取特定的参数值
    const code = params.get("code");
    const subCode = params.get("subCode");
    const msg = params.get("msg");
    const subMsg = params.get("subMsg");

    const script = document.createElement('script');
    script.src = 'https://res.wx.qq.com/open/js/jweixin-1.6.0.js';
    document.head.appendChild(script);
    script.onload = () => {
      if (wx.miniProgram) {
        wx.miniProgram.navigateTo({
          url: `/pages/my/certification/certification?code=${code}&subCode=${subCode}&msg=${msg}&subMsg=${subMsg}`,
        });
      };
    };
  }
}
</script>

<style lang="scss" scoped></style>